abstract class Account {
	private double balance;
	private int transactions;
	
	public Account(){
		balance = 0.0;
		transactions = 0;
	}
	
	public void deposit(double amount){
		balance += amount;
		transactions++;
	}
	
	public void withdraw(double amount){
		if(amount > balance) return;
		balance -= amount;
		transactions++;
	}
	
	public void endMonth(){
		balance -= endMonthCharge();
		System.out.printf("%.2f %d\n", balance, transactions);
		transactions = 0;
	}
	
	abstract double endMonthCharge();
}
